package com.bea.ftd.routing.fallback;

import com.bea.ftd.common.model.MappingRequest;
import com.bea.ftd.common.model.MappingResponse;
import com.bea.ftd.common.model.MsgInRequest;
import com.bea.ftd.common.model.MsgOutResponse;
import com.bea.ftd.routing.feign.MappingFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;

public class MappingFallback implements MappingFeign {
    @Autowired
    private KafkaTemplate kafkaTemplate;

    @Override
    public MappingResponse checkMsgInData(MappingRequest data) {
        kafkaTemplate.send("mapping", data);
        return new MappingResponse(1,"调用报文转换服务失败",null);
    }

    @Override
    public MsgOutResponse transMsg(MsgInRequest request) {
        return  new MsgOutResponse(1,"调用报文转换服务失败",null);
    }
}
